<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        // 测试一
        /* console.log(a); // Uncaught ReferenceError: a is not defined
        function test() {
            var a = 10;
            console.log(a);
        }
        test();
        console.log(a); */

        // 测试二
        /* console.log(num); // undefined
         var num = 10;  */

        // 测试二 let
        /* console.log(num); // Cannot access 'num' before initialization
        let num = 10; */

        // 测试三
        /* fn(); // 打印

        function fn() {
            console.log('打印');
        } */
    </script>
</body>

</html>